<?php
$mid=$_GET['mid'];
$smid=$_GET['smid'];

require_once 'class/EmpRegister.php';
$att = new EmpRegister();
?>
<?
if(isset($_POST['Submit']))
	{
		if($_POST['uid']=='')
		{	
		$att->Add();
?>
			<script type="text/javascript"> 
			alert("User Added Successfully..!"); 
			window.location.href="modules.php?file=user_list&mid=<?echo $mid?>&smid=<? echo $smid?>"
			</script> 
<?
		}
		
		else
		{
         $att->Update($_POST['uid']);
?>
			<script type="text/javascript"> 
			alert("User Modified Successfully..!"); 
			window.location.href="modules.php?file=user_list&mid=<?echo $mid?>&smid=<? echo $smid?>"
			</script> 
<?		 
		}
	
	   print "<script>";
	   print "self.location='modules.php?file=user_list&mid=$mid&smid=$smid'";		
	   print "</script>";	
	}
?>